<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/8/22
 * Time: 11:32
 */

namespace app\alliance\controller;


use app\service\IntegralService;
use think\App;

class IntegralExchange extends Common
{
    public $IntegralService;
    function __construct(App $app = null)
    {
        parent::__construct($app);
        $this->IntegralService=new IntegralService();
    }

    function index()
    {
        $pro_type=input("post.pro_type");
        $min=input("post.min");
        $max=input("post.max");
        $order=input("post.order");
        if($order=='top'){
            $order='asc';
        }else{
            $order='desc';
        }
        return $this->IntegralService->integralShop($pro_type,$min,$max,$order);
    }

    /**
     * @return array
     * @context 立即兑换提交
     */
    function immediatelyChange()
    {
        $id=input("post.id");
        return $this->IntegralService->immediatelyChange($id,$this->code);
    }

}